package com.ccit.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("user")
public class indexController {

    /**
     * 首页
     * @return
     */
    @RequestMapping("/index")
    private String index(){
        return  "user/index";
    }

    /**
     * 添加
     */
    @RequestMapping("insert")
    @RequiresPermissions("user:insert")
    public String insert(){
        System.out.print("执行了用户添加");
        return  "user/insert";
    }


    /**
     * 修改
     */
    @RequestMapping("update")
    @RequiresPermissions("user:update")
    private String update(){
        System.out.print("执行了用户修改");
        return  "user/update";
    }


    /**
     * 删除
     */
    @RequestMapping("delete")
    @RequiresPermissions("user:delete")
    private String delete(){
        System.out.print("执行了用户删除");
        return  "user/delete";
    }

    /**
     * 没有权限
     */
    @RequestMapping("nopermission")
    private String unauthorized(){
        return  "unauthorized";
    }

}
